public class OutputFactory{
	public Output getOutput(){
		//这里修改的地方.就算有1000个类,只需要这里一次就可以
		return new BetterPrinter();
	}
	public static void main(String[] args){
		OutputFactory of = new OutputFactory();
		Computer c = new Computer(of.getOutput());
		c.keyIn("轻量级JavaEE企业应用实战");
		c.keyIn("疯狂Java讲义");
		c.print();
	}
}